//package com.zdkj.subway.st.task;
//
//import com.zdkj.common.core.util.SpringContextHolder;
//import com.zdkj.subway.st.service.SwStStockMonthCheckDetailService;
//import com.zdkj.subway.st.service.impl.SwStStockMonthCheckDetailServiceImpl;
//import lombok.extern.slf4j.Slf4j;
//import org.springframework.scheduling.annotation.Scheduled;
//import org.springframework.stereotype.Component;
//
//import java.util.Calendar;
//
///**
// * @ProjectName: zdkj
// * @Package: com.zdkj.subway.st.task
// * @ClassName: StockMonthScheduledTask
// * @Description:每月月底最后一天定时，触发月结账
// * @Author: kangjian
// * @CreateDate: 2020/1/19 18:39
// * @Version: 1.0
// */
//@Component
//@Slf4j
//public class StockMonthScheduledTask {
//
////    public static final String DefaultMonth="2020-02-04";
//
//    public static final String DefaultMonth="";
//
////    public static final String ENDMonth="2020-02-28";
//
//    public static final String ENDMonth="";
//
//    //cron定时每月月底，最后一天23点29分更新月结账 ：corn 为0 59 23 L * ?
//    //由于spring的Scheduled不支持L，顾要加判断
//    //定时任务待定
//    @Scheduled(cron = "0 59 23 28-31 * ?")
//    public void executeStockMonth() {
////        final Calendar c = Calendar.getInstance();
////        if (c.get(Calendar.DATE) == c.getActualMaximum(Calendar.DATE)) {
////            //确保是最后一天
////            SwStStockMonthCheckDetailService swStStockMonthCheckDetailService= SpringContextHolder.getBean(SwStStockMonthCheckDetailServiceImpl.class);
////            if(!swStStockMonthCheckDetailService.genmonthStock(DefaultMonth,DefaultMonth)){
////                throw new RuntimeException("月库存报表生成异常！");
////            }
////            log.info("测试月计划报表");
////        }
//    }
//
//
//    @Scheduled(fixedDelay = 40000)
//    public void second() {
////        //确保是最后一天
////        SwStStockMonthCheckDetailService swStStockMonthCheckDetailService= SpringContextHolder.getBean(SwStStockMonthCheckDetailServiceImpl.class);
////        if(!swStStockMonthCheckDetailService.genmonthStock(DefaultMonth,ENDMonth)){
////            throw new RuntimeException("月库存报表生成异常！");
////        }
////        log.info("测试月计划报表");
//    }
//
//}
